package minefak3r;

/**
 *
 * @author Chriss & D4rky!
 */
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.net.URL;
import java.util.Date;

public class Logger extends Thread {

    PrintStream ps;
    String path;
    URL url;

    public Logger(String path) throws Exception {
        this.path = path;
        File f = new File(path);
        f.createNewFile();
        ps = new PrintStream(new FileOutputStream(path,true));
        Date d = new Date();
        ps.println();
        ps.println("--------------------------" + "["  + d.getDate() + " : " + d.getMonth() + " : " + d.getYear() + "]" +"---------------------------");
        ps.flush();
    }

    public void Log(String log) {
        Date d = new Date();
        ps.println(" [ " + d.getHours() + " / " + d.getMinutes() + " / " + d.getSeconds() + " ] " + log);
        ps.flush();
    }
}
